import { ElMessageBox } from 'element-plus'
import { AlertFunc, MessageProp, ConfirmFunc } from './message.type'

const alert: AlertFunc = (message: string, title?: string) => {
  return ElMessageBox.alert(message, title || '提示', {
    confirmButtonText: '确认',
    cancelButtonText: '取消'
  })
}
const confirm: ConfirmFunc = (message: string, title?: string) => {
  return ElMessageBox.confirm(message, title || '提示', {
    confirmButtonText: '确认',
    cancelButtonText: '取消'
  })
}
const message: MessageProp = {
  alert,
  confirm
}

export default message
